Code
from specs import *Yiwei Mao
November 28, 2023
# from spectrometers.ipynb
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import xarray as xr
import holoviews as hv
hv.extension("bokeh", logo=False)
import matplotlib.pyplot as plt
from datetime import datetime, timezone
from scipy.interpolate import interp1d
from fastcore.foundation import patch
from fastcore.dispatch import typedispatch # only types of first two arguments used
from tqdm import tqdm
from holoviews import opts
from holoviews.streams import Pipe, Buffer
from typing import Iterable, Union, Callable, List, TypeVar, Generic, Tuple, Optionalidx = np.sum(oo.wavelengths<690)
curve = temp_blue[:,idx-14:idx+14].mean(axis=1)
for i,j in zip(curve>200,range(len(curve))):
if i:
curve[j] = (curve[j-2]+curve[j+2])/2
for i,j in zip(curve>150,range(len(curve))):
if i:
curve[j] = (curve[j-3]+curve[j+3])/2
ga
hv.Curve( zip(np.arange(len(curve))*(oo.exposure+32)/1000,curve) ).opts(
width=800,xlabel="seconds (s)",ylabel="counts",ylim=(0,170),title="wavelength 685-695 nm, Blue LED")